//必须throw一个error才能catch一个error
#include<iostream>
#include<string>
using namespace std;
void test1()
{
    cout<<"hello world2"<<endl;
    if(true)
    {
        throw runtime_error("error here mustly");
    }
    cout<<"hello world"<<endl;
}
void test2()
{
    cout<<"hello world1"<<endl;
    try{
        cout<<"there is no problem"<<endl;
        // cout<<1/0<<endl;
        throw runtime_error("error here mustly");
        cout<<endl;
    }catch(runtime_error err)
    {
        cout<<err.what()<<endl;
    }
    cout<<"hello world1"<<endl;
}
void test3()
{
    try
    {
        cout<<1/0<<endl;
        // throw exception();
    }catch(exception e)
    {
        cout<<e.what()<<endl;
        cout<<"succeed catching"<<endl;
    }
}
int main()
{

    // test1();
    // test3();
    return 0;
}
